<p><?php echo $html->link("Trang Chủ »", "/recipes"); ?> Món Ăn »</p>
<h1>Chế biến món ăn (<?php echo $recipes_count ?> món)</h1>
<ul>
  <?php if (!empty($categories)) { foreach($categories as $category) { ?>
  <li><h2><a href="#<?php echo $category["Category"]["permalink"]; ?>"><?php echo $teefan->displayContent($category["Category"]["name"]); ?></a> <span style="font-size:12px;color:#999;">(<?php echo sizeof($category["Recipe"]) ?> món)</span></h2></li>
  <?php } } ?>
</ul>

<h1>Danh sách món ăn theo loại</h1>
<?php if (!empty($categories)) { foreach($categories as $category) { ?>
<a name="<?php echo $category["Category"]["permalink"]; ?>"></a>
<h2><?php echo $teefan->displayContent($category["Category"]["name"]); ?> <span style="font-size:12px;color:#999;">(<?php echo sizeof($category["Recipe"]) ?> món)</span></h2>
<ul>
  <?php if (!empty($category["Recipe"])) { foreach($category["Recipe"] as $recipe) { ?>
  
  <?php if ($recipe["approved"] == "1" || $session->read("Account.level") > 0) { ?>
  <?php
    $favorite_count = $this->requestAction("/favorites/get_favorite_count/".$recipe["id"]);
  ?>
  <li><?php echo $html->link($teefan->displayContent($recipe["name"]), "/recipes/show/".$recipe["permalink"]); ?> <?php if ($favorite_count > 0) { ?><span>(<?php echo $favorite_count ?> người thích)</span><?php } ?> <?php if ($session->read("Account.level") > 0) { ?><span><?php if ($recipe["approved"] == 0) { ?>(ẩn)<?php } ?></span><?php } ?></li>
  <?php } ?>
  
  <?php } } ?>
</ul>
<?php } } ?>